<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
				xmlns:c="http://java.sun.com/jstl/core"
	  			xmlns:sf="http://www.springframework.org/tags/faces"
				template="/WEB-INF/layouts/standard.xhtml">

<ui:define name="content">

<div class="totals">
	<h3>Прогноз на матчи - #{nexttourname}</h3>
	<ui:fragment id="messages">
		<div id="messagesInsertionPoint">
			<h:messages errorClass="errors" />
		</div>
	</ui:fragment>
	<h:form id="bet">
		<ui:fragment id="betFragment" rendered="#{(nexttourid > 0) &amp;&amp; (nexttourid &lt; 100)}">
			<div>
				<h:dataTable id="bets" value="#{betByMatchBean.dataList}" var="b" columnClasses="colLeft,colRight,colLeft">
					<h:column>
						<a href="#{b.matchurl}" target="_blank">
							<h:outputText value="#{b.matchid}. "/>
							<h:outputText value="#{b.matchdate}">
								<f:convertDateTime pattern="dd.MM.yyyy HH:mm" timeZone="GMT+3"/>
							</h:outputText>
						</a>
					</h:column>
					<h:column>
						<a href="#{b.teamurl1}" target="_blank"><h:outputText value="#{b.teamname1} "/><img src="${request.contextPath}/imageservlet?teamid=#{b.teamid1}"/></a>
						<sf:clientNumberValidator regExp="[0-9]{1}" invalidMessage="Число от 0 до 9">
							<h:inputText size="1" value="#{b.score1}" immediate="false"/>
						</sf:clientNumberValidator>
						&nbsp;:
					</h:column>
					<h:column>
						<sf:clientTextValidator regExp="[0-9]{1}" invalidMessage="Число от 0 до 9">
							<h:inputText size="1" value="#{b.score2}" validator="#{betByMatchBean.validateMatch}" />
						</sf:clientTextValidator>
						<a href="#{b.teamurl2}" target="_blank"><img src="${request.contextPath}/imageservlet?teamid=#{b.teamid2}"/><h:outputText value=" #{b.teamname2}"/></a>
					</h:column>
				</h:dataTable>
			</div>
			<div class="buttonGroup">
				<sf:validateAllOnClick>
					<sf:commandButton id="proceed" action="#{betByMatchBean.saveDataList}" processIds="*" value="Далее &gt;"/>&#160;
				</sf:validateAllOnClick>
			</div>		
		</ui:fragment>
	</h:form>
</div>
</ui:define>
</ui:composition>